<?php

/**
 * Ftpuser form base class.
 *
 * @package    form
 * @subpackage ftpuser
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseFtpuserForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'userid'     => new sfWidgetFormInput(),
      'passwd'     => new sfWidgetFormInput(),
      'uid'        => new sfWidgetFormInput(),
      'gid'        => new sfWidgetFormInput(),
      'homedir'    => new sfWidgetFormInput(),
      'shell'      => new sfWidgetFormInput(),
      'count'      => new sfWidgetFormInput(),
      'created_at' => new sfWidgetFormDateTime(),
      'updated_at' => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorDoctrineChoice(array('model' => 'Ftpuser', 'column' => 'id', 'required' => false)),
      'userid'     => new sfValidatorString(array('max_length' => 32)),
      'passwd'     => new sfValidatorString(array('max_length' => 32)),
      'uid'        => new sfValidatorInteger(),
      'gid'        => new sfValidatorInteger(),
      'homedir'    => new sfValidatorString(array('max_length' => 255)),
      'shell'      => new sfValidatorString(array('max_length' => 16, 'required' => false)),
      'count'      => new sfValidatorInteger(array('required' => false)),
      'created_at' => new sfValidatorDateTime(array('required' => false)),
      'updated_at' => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('ftpuser[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Ftpuser';
  }

}
